Function Get-Shares
{		
	$comps = Get-Content "D:\Powershell\Computers.txt"
	If ($comps -ne $Null) {
	$totalObj = @()

		foreach ($comp in $comps){
			$shares = Get-WmiObject -Class Win32_Share -ComputerName $comp
			foreach ($share in $shares){
				$obj=New-Object PSObject
				$obj | Add-Member -MemberType NoteProperty -Name "ServerName" -Value $comp
				$obj | Add-Member -MemberType NoteProperty -Name "ShareName" -Value $share.Name
				$obj | Add-Member -MemberType NoteProperty -Name "SharePath" -Value $share.Path
				$obj | Add-Member -MemberType NoteProperty -Name "Description" -Value $share.Description
				$totalObj += $obj
			}
		}		
	$totalObj | Export-Csv -NoTypeInformation -Encoding 'Unicode' -Path "D:\Powershell\SharesOut.csv"
	} else {
	write-host "Pre-requisite is not in place" -ForegroundColor Red
	}
}